home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: genesis.ilinkgn.net!not-for-mail
- From: johno@ilinkgn.net (john)
- Subject: HELP!! Need help with a printer driver in C++
- Message-ID: <2f7cc$10232.cf@genesis.ilinkgn.net>
- Date: Thu, 15 Feb 1996 21:35:02 GMT
- Organization: ilink global networks
- X-Newsreader: WinVN 0.99.7
- MIME-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
-
- I am trying to write a printer driver in c++ using classes and inline
- functions that are called to change the settings of an HP printer and
- then reset the printer with a destructor after each is executed. Any
- help would be appreciated greatly!
-
- Thanks
- C++
- Novice
-
- #include <iostream.h>
- #include <iomanip.h>
- #include <fstream.h>
-
-
-
- class Printer{
-
- ofstream prt;
-
- public:
- Printer()
-
-
- prt open ("prn"); // <<<--- KEEP GETTING
- // "DECLARATION TERMINATED INCORRECTLY
- ERRORS
-
-
- void bold() {prt << "\x1B\x28\x73\x33\x42";}
- void score() {prt << "\x1B\x26\x64\x44";}
- void clmarg() {prt << "\x1B\x39";}
- void lscape() {prt << "\x1B\x26\x6C\x31\x4F";}
- void portrt() {prt << "\x1B\x26\x6C\x30\x4F";}
- void italic() {prt << "\x1B\x28\x73\x31\x53";}
- void uprite() {prt << "\x1B\x28\x73\x30\x53";}
-
- };
- {
-
- ~Printer();
-
- void(){prt << "\x1B\x45";}
- reset;
-
- prt close ("prn"); // <<<--- KEEP GETTING
- // "DECLARATION TERMINATED INCORRECTLY
- ERRORS
-
- }
- {
- print line (char s [])
- void page(){prt << '\f';}
-
- }
- void main ()
-
- {
-
- }
-
-
-